{% extends "_layout.html" %}
{% import "component/forms.njk" as forms %}
{% import "component/constant.njk" as constant %}

{# 样式代码 #}
{% block style %}
<link href="/css/plugins/iCheck/custom.css" rel="stylesheet">
{% endblock %}

{# bodyd代码#}
{% block body %}
{% if data != null%}
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>订单详细</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="m-b-md">
                                <h2>{{ data.orderName }}</h2>
                            </div>
                            <dl class="dl-horizontal">
                                <dt>状态：</dt>
                                <dd><span class="label label-primary">{{ constant.status(data.status) }}</span>
                                </dd>
                            </dl>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-sm-5">
                            <dl class="dl-horizontal">
                                <dt>订单号：</dt>
                                <dd>{{ data.orderNo }}</dd>
                                <dt>订单金额：</dt>
                                <dd>￥{{ data.price }}</dd>
                                <dt>优惠金额：</dt>
                                <dd>￥{{ data.privilegePrice }}</dd>
                                <dt>配送费：</dt>
                                <dd>￥{{ data.deliverPrice }}</dd>
                                <dt>餐具费：</dt>
                                <dd>￥{{ data.tablewarePrice }}</dd>
                                <dt>餐具数量：</dt>
                                <dd>{{ data.tablewareNumber }}</dd>
                                <dt>订单来源：</dt>
                                <dd>{{ constant.source(data.orderSource) }}</dd>
                                <dt>支付方式：</dt>
                                <dd>{{ constant.pay_type(data.payType) }}</dd>
                                <dt>创建时间：</dt>
                                <dd>{{ data.createTime }}</dd>
                            </dl>
                        </div>
                        <div class="col-sm-7" id="cluster_info">
                            <dl class="dl-horizontal">
                                <dt>收件人姓名：</dt>
                                <dd>{{ data.name }}</dd>
                                <dt>性别：</dt>
                                <dd>{{ constant.sex(data.sex) }}</dd>
                                <dt>收件人手机号：</dt>
                                <dd>{{ data.mobile }}</dd>
                                <dt>地址：</dt>
                                <dd>
                                {{ data.areaInfo }}
                                {{ data.detail }}
                                </dd>
                                <dt>送餐时间：</dt>
                                <dd>
                                {{ data.arriveTime }}前送达
                                </dd>
                                <dt>下单人手机：</dt>
                                <dd>{{ member.mobile }}</dd>
                                <dt>下单人昵称：</dt>
                                <dd>{{ member.nickname }}</dd>
                            </dl>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-sm-12">
                            <dl class="dl-horizontal">
                                <dt>卡片备注</dt>
                                <dd>
                                    <small>{{ data.message }}</small>
                                </dd>
                            </dl>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-sm-12">
                            <dl class="dl-horizontal">
                                <dt>需求</dt>
                                <dd>
                                    <small>{{ data.remark }}</small>
                                </dd>
                            </dl>
                        </div>
                    </div>

                    <div class="table-responsive">
                        {% if data.orderItem == '' %}
                        <table class="table">
                            <thead>
                                <tr>
                                    <th width="80">图片</th>
                                    <th>名称</th>
                                    <th>口味</th>
                                </tr>
                            </thead>
                            <tbody>
                                {% for item in data.goodsInfo %}
                                <tr>
                                    <td class="image" width="80">
                                       <img alt="image" class="image" src="{{ ctx.helper.showImage(item.image, 50, 50, 'fixed') }}">
                                   </td>
                                    <td>
                                        <div>
                                        <strong>{{ item.name }}</strong>
                                        </div>
                                    </td>
                                    <td>{{ item.taste }}</td>
                                </tr>
                                {% endfor %}
                            </tbody>
                        </table>
                        {% else %}
                            <table class="table">
                                <thead>
                                <tr>
                                    <th>名称</th>
                                    <th>数量</th>
                                    <th>送餐时间</th>
                                    <th>下单时间</th>
                                </tr>
                                </thead>
                                <tbody>
                                {% for item in data.orderItem %}
                                    <tr>
                                        <td>
                                            <div>
                                                <strong>{{ item.name }}</strong>
                                            </div>
                                        </td>
                                        <td>{{ item.number }}</td>
                                        <td>{{ ctx.helper.date(data.bookingTime, 'YYYY-MM-DD') }}
                                            {{ data.arriveTime }}</td>
                                        <td>{{ item.createTime }}</td>
                                    </tr>
                                {% endfor %}
                                </tbody>
                            </table>
                        {% endif %}
                    </div>


                </div>
            </div>
        </div>

    </div>
</div>
{% else %}
    <div class="middle-box text-center animated fadeInDown">
        <h3 class="font-bold">订单不存在！</h3>

        <div class="error-desc">
            抱歉，你查询的订单未找到
        </div>
    </div>

{% endif %}
{% endblock %}

{#js代码#}
{% block js %}
{% endblock %}